<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>iScroll iPad example</title>
          <link rel="stylesheet" href="css/style.css">
  <script src="js/libs/jquery-1.7.1.min.js"></script>        
<script type="text/javascript" src="js/iscroll.js"></script>
          <script src="phonegap-1.2.0.js" charset="utf-8"></script>
           <script src="ChildBrowser.js" charset="utf-8"></script>
 <script>
   function addpic()
  {
       navigator.camera.getPicture(onPhotoDataSuccess, onFail, 
                { quality : 100, 
                destinationType : Camera.DestinationType.DATA_URL, 
                sourceType : Camera.PictureSourceType.CAMERA, 
                allowEdit : true,
                encodingType: Camera.EncodingType.JPEG,
                targetWidth: 220,
                targetHeight: 300 }
                );
      
  }
  function onPhotoDataSuccess(imageData) {
      // Uncomment to view the base64 encoded image data
    //  imageURI2=imageData;
      $('#img-profile').attr('src','data:image/jpeg;base64,'+imageData); 
    //  $.post(webdir+'/ajax/submitmyprofileformiphone',{
//                     pic1:imageData
//                     ,mid:localStorage.getItem("userId")
//                     ,username:localStorage.getItem("username")
//                     
//      }, function(data) {
//             localStorage.setItem("picme",'data:image/jpeg;base64,'+imageData);        
//                   
//      });
       

    }
 </script>
<script>
            var webdir='http://www.2admin.co.cc';
            var limit=10;
            var start=0;
            var pageselect=1;
            $(document).ready(function() {
                getdownload();
            });
            
            document.addEventListener("deviceready",onDeviceOk,false);
            function onDeviceOk()
            {        
            childBrowser = ChildBrowser.install();
            }
            function openpdf(pdf)
            {
                if((navigator.userAgent.match(/iPad/i)))
                {
                    window.plugins.childBrowser.showWebPage(webdir+'/uploads/'+pdf);
                }else
                {
                    
                }
                
            }
            
            function getdownload(){
                
                $.post(webdir+'/ajax.php',{functioncall:'getdownload',uid:localStorage.getItem("uid"),gid:localStorage.getItem("gid"),start:start,limit:limit} ,function(data) {
                 var myObject = eval('(' + data + ')');  
                 $('#downloadlist').html(''); 
                 for (variable in myObject.data)
                 {   
                 var obj = myObject.data[variable]; 
            //     var strobj='<tr><td>'+obj.topic+'</td><td>'+obj.desc+'</td><td><a href="javascript:openpdf(\''+obj.file+'\')">'+obj.file+'</a></td><td>'+obj.createdate+'</td></tr>';
                
                  
                  var str=' <li><div class="member"><img  src="images/icon_doc.png"></div><div class="post"><strong>Filename :</strong>'+obj.topic+'<br><strong>Filetype :</strong>'+obj.filetype+'<br><strong>Upload Date :</strong>'+obj.createdate+'<span class="num green"><a href="'+webdir+'/uploads/'+obj.file+'"><img src="images/download.png" width="129" height="39"></a></span></div></li>';
                 
                 $('#downloadlist').append(str);
             }
             
                 
             var totalpage=Math.ceil((myObject.count)/(limit) );
             
             $('.pagebarUTH').html('');
             $('.pagebarUTH').append('<a href="javascript:;" title="Seite 2">จำนวนกระทู้ '+myObject.count+'</a>&nbsp;');
             if(totalpage!=1)
             {
                var previous= totalpage-1;
                 $('.pagebarUTH').append('<a href="javascript:changepage('+previous+');" title="Seite 2"><< Previous</a>&nbsp;');
             }
             
             for(var i=1;i<=totalpage;i++)
             {
                 if(i==pageselect)
                 {
                  var strlink='<span class="this-page">'+i+'</span>';   
                 }else
                 {
                  var strlink='<a href="javascript:changepage('+i+');" title="Seite 2">'+i+'</a>';    
                 }
                 $('.pagebarUTH').append(strlink);
                 
             }
             
             if(totalpage!=1)
             {
                var next= totalpage+1;
                 $('.pagebarUTH').append('<a href="javascript:changepage('+next+');" title="Seite 2">Next >></a>');
                 $('.pagebarUTH').append('<a href="javascript:changepage('+totalpage+');" title="Seite 2">Last</a>');
             }
                });
            
                
            }
           </script>
<script type="text/javascript">
var scrollContent;
var scrollContent2;
var scrollSide;

function loaded() {
    scrollContent = new iScroll('contentScroller');
    scrollSide = new iScroll('navScroller');
}

document.addEventListener('touchmove', function(e){ e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', loaded, false);
</script>

<link rel="stylesheet" href="css/iscroll.css"> 
<link rel="stylesheet" href="css/login.css"> 



</head>
<body>

<div id="page">
    <div id="sidebar">
        <header>Menu</header>
        <nav>
                    <a href="javascript:void(0);"><img id="img-profile" onclick="addpic()" src="images/img-avatar.jpg" alt="img-avatar" /></a>
           <h3>Feature</h3>
           <ul id="navScroller" class="v">
                       <li><a href="forum.html" class="icon">Forum</a></li>
                      <li><a href="index.html" class="icon">Calendar</a></li>
                      <li><a href="message.html" class="icon">Private Message</a></li>
                      <li><a href="meetingroom.html" class="icon">Meeting Room</a></li>
                      <li><a href="download.html" class="icon">Document Download</a></li>
                  </ul>
        </nav>
    </div>

    <div id="content">
        <header>Download PDF</header>
        <article>
            <div id="contentScroller" class="clearfix">
                         <div id="downloaddoc">
                          <ul class="latest" id="downloadlist">

                              


                          
                          
                          
                          </ul>
                      </div>
                      
                      
                      <dl id="event">
                      <dt></dt>
                          <dd>
                              <table>
                                  <tbody></tbody>
                                  <tfoot>
                                      <tr>
                                          <td id="pagination" colspan="7">
                                              <label for="page">Page  1 of  0</label>  <a href="">›</a>                                          </td>
                                      </tr>
                                  </tfoot>
                              </table>
                          </dd>
                      </dl>                              
            </div>
            

        </article>
    </div>
</div>
<script src="js/default/login.js"></script>

</body>
</html>